package com.example.myfirsttvapplication.slice;

import com.example.myfirsttvapplication.ResourceTable;
import ohos.aafwk.ability.AbilitySlice;
import ohos.aafwk.content.Intent;
import ohos.agp.components.Text;

public class MainAbilitySlice extends AbilitySlice {
    @Override
    public void onStart(Intent intent) {
        super.onStart(intent);
        super.setUIContent(ResourceTable.Layout_ability_main);

        Text text = (Text) findComponentById(ResourceTable.Id_text_title);


// 设置自动调整规则
        text.setAutoFontSizeRule(30, 100, 1);
// 设置点击一次增多一个"T"
        text.setClickedListener(Component -> text.setText(text.getText() + "T"));
    }

    @Override
    public void onActive() {
        super.onActive();
    }

    @Override
    public void onForeground(Intent intent) {
        super.onForeground(intent);
    }
}
